﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.DBUtility;
public partial class Supervise_GoodsDetails : System.Web.UI.Page
{
    Int64  GoodsId;
    string strSql;
    public string straa;
    protected void Page_Load(object sender, EventArgs e)
    {
        System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> _AccountType = new System.Collections.Generic.List<HZ.MBSM.DAL.AccountType>();
        _AccountType.Add(HZ.MBSM.DAL.AccountType.enumSupervise);
        if (HZ.MBSM.BLL.Login.CheckAssert(_AccountType))
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["GoodsId"] == null)
                {
                    Response.Write("没有要查看的商品编码！！！");
                }
                else
                {
                    GoodsId = Convert.ToInt64(SysFun.IsSQL(Request.QueryString["GoodsId"].ToString()));
                    Db db = new Db();
                    System.Data.IDataReader dr;

                    strSql = "select * from v_product_goods where GoodsId=" + GoodsId.ToString();
                    dr = db.DataReader(strSql);
                    while (dr.Read())
                    {

                        lblAccountId_TJR.Text = dr["AccountId_TJR"].ToString();
                        lblAccountId_TJR.Visible = false;
                        hidProductId.Value = dr["ProductId"].ToString();
                        //labProductId.Visible = false;
                        labProductCode.Text = dr["ProductCode"].ToString();
                        labProductName.Text = dr["productname"].ToString();
                        labOutlookc.Text = dr["outlookc"].ToString();
                        labMedicinemodel.Text = dr["medicinemodel"].ToString();
                        labUnit.Text = dr["unit"].ToString();
                        lblCompany.Text = dr["companyName"].ToString();
                        lblFactor.Text = dr["xishu"].ToString();
                        lblGoodsId.Text = dr["goodsid"].ToString();
                        lblGoodsId.Visible = false;
                        txtGoodsInstruction.Text = dr["GoodsInstruction"].ToString();
                        lblGoodsName.Text = dr["goodsname"].ToString();
                        lblImportCode.Text = dr["ImportCode"].ToString();
                        if (dr["ImportRegistDate"].ToString() != "1900-1-1 0:00:00")
                        {
                            lblImportRegistDate.Text = dr["ImportRegistDate"].ToString();
                        }
                        lblIsSalerId.Text = dr["AccountId_SC"].ToString();
                        lblLicenseNumber.Text = dr["licensenumber"].ToString();
                        if (dr["licensenumberdate"].ToString() != "1900-1-1 0:00:00")
                        {
                            lblLicenseNumberDate.Text = dr["licensenumberdate"].ToString();
                        }
                        lblMaterial.Text = dr["Material"].ToString();
                        lblPackUnit.Text = dr["unit"].ToString();
                        lblPackUnit.Visible = false;

                        switch (SysFun.ToTrim(dr["QualityLevels"]))
                        {
                            case "0":
                                lblQualityLevels.Text = "普通GMP药品";
                                break;
                            case "1":
                                lblQualityLevels.Text = "专利药品";
                                break;
                            case "2":
                                lblQualityLevels.Text = "1999年以来获得国家科学技术奖的药品";
                                break;
                            case "3":
                                lblQualityLevels.Text = "国家一类新药";
                                break;
                            case "4":
                                lblQualityLevels.Text = "原研制药品";
                                break;
                            case "5":
                                lblQualityLevels.Text = "单独定价药品";
                                break;
                            case "6":
                                lblQualityLevels.Text = "优质优价中成药";
                                break;
                            case "7":
                                lblQualityLevels.Text = "全国医药工业百强企业的药品";
                                break;
                            case "8":
                                lblQualityLevels.Text = "中药保护品种";
                                break;
                            case "9":
                                lblQualityLevels.Text = "欧美认证药品";
                                break;
                        }

                        lblRetailPrice.Text = dr["RetailPrice"].ToString();

                        if (dr["SurveyReportDate"].ToString() != "1900-1-1 0:00:00")
                        {
                            lblSurveyReportDate.Text = dr["SurveyReportDate"].ToString();
                        }

                        lblSurveyReportId.Text = dr["SurveyReportId"].ToString();
                        if (SysFun.ToTrim( dr["IsImport"])== "1")
                        {
                            lblIsImport.Text ="是";                           
                        }
                        else 
                        {
                            lblIsImport.Text = "否";
                            
                        }
                        //if (chkIsImport.Checked == false)
                        //{
                        //    straa = "none";
                        //}
                        //else
                        //{
                        //    straa = "block";
                        //}
                        if (dr["IsSurveyReport"].ToString() != "1")
                        {
                            lblSrt.Text = "有";
                        }
                        else
                        {
                            lblSrt.Text = "无";
                        }

                        lblAccountId_TJR.Text = dr["accountid_tjr"].ToString();
                        lblAccountId_TJR.Visible = false;
                        lblIsalerId_dL.Text = dr["AccountId_Agent"].ToString();
                        lblIsalerId_dL.Visible = false;
                        lblIsSalerId.Text = dr["AccountId_SC"].ToString();
                        lblIsSalerId.Visible = false;
                        lblCompany_dl.Text = dr["companyName_Agent"].ToString();
                        lblMemo4.Text = SysFun.ToTrim(dr["memo4"]);
                        txtMemo5.Text = dr["memo5"].ToString();
                        lblImgUrl.Text = dr["ImgUrl"].ToString();
                        lblImgUrl.Visible = false;
                        lblMemo3.Text = dr["Memo3"].ToString();
                        lblMemo3.Visible = false;
                        if ( SysFun.ToTrim(dr["ImgUrl"])=="")
                        {
                            labImg.Text = "图片未上传";
                        }
                        else
                        {
                            //Image1.ImageUrl = "~/UploadFile/" + dr["ImgUrl"];
                            labImg.Text = "<a target=_blank href='GoodsUpdate_Img.aspx?ImgUrl=" + dr["ImgUrl"] + "'><img  src='../UploadFile/" + dr["ImgUrl"] + "' height='85px'  /></a>";

                        }
                        txtshdiscrible.Text = dr["sh_discrible"].ToString();

                    }
                    dr.Close();
                    dr.Dispose();
                    db.Close();


                }
            }
        }
    }
 
}
